﻿using ShareFrame.Entity.DTO;
using ShareFrame.Util.ClassLibrary;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace ShareFrame.Api.Extentions
{
    public static class SettingExtentions
    {
        public static IServiceCollection AddSetting(this IServiceCollection services, IConfiguration configuration)
        {
            //加载MongoDB配置
            services.Configure<MongoDBOptions>(configuration.GetSection("MongoDB"));

            //加载Dapper配置
            services.Configure<BaseDbOption>(configuration.GetSection("Database").GetSection("BaseDb"));

            //加载微信小程序配置
            services.Configure<WxMiniAppConfig>(configuration.GetSection("WxMiniAppConfig"));


            return services;
        }
    }
}
